<script setup>
import { reactive,ref } from "vue";
import { ipc } from '@/utils/ipcRenderer'
import { ipcApiRoute } from "@/api";
import {message} from "ant-design-vue";

const setSystemWallpaper = () => {
  ipc.invoke(ipcApiRoute.systemService.setWallpaper).then(res => {
    if(res.code == 200){
      wallpaperPath.value = res.data
      message.success(res.msg)
    }else {
      message.error(res.msg)
    }
  })
}


const wallpaperPath = ref('')

const getSystemWallpaper = () => {
  ipc.invoke(ipcApiRoute.systemService.getWallpaper).then(res => {
    wallpaperPath.value = res
  })
}

getSystemWallpaper()

</script>

<template>
  <div class="system-quickly-setting">
    <div class="flex items-center justify-between">
      <div class="">壁纸路径</div>
      <div class="flex-1 ml-1 mr-1">{{ wallpaperPath }}</div>
      <div>
        <a-button @click="setSystemWallpaper">
          <label for="switchimg">选择壁纸</label>
        </a-button>
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">

</style>